.PHONY: macapp
macapp: $(bin).app

$(bin).app: $(bin)
	mkdir -p $(bin).app/Contents/MacOS $(bin).app/Contents/Frameworks
	cd $(bin).app/Contents && \
		rm -f Info.plist && \
		ln -s ../../../tests-macinfo.plist Info.plist
	cp $(bin) $(bin).app/Contents/MacOS/$(bin)
	cd $(bin).app/Contents/Frameworks && \
		rm -f libglory.dylib && \
		ln -s ../../../../libglory.dylib .
	install_name_tool -change libglory.dylib @execitable_path/../Frameworks/libglory.dylib \
		$(bin).app/Contents/MacOS/$(bin)
